/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.Size;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "salonxmd")
@NamedQueries({
    @NamedQuery(name = "Salonxmd.findAll", query = "SELECT s FROM Salonxmd s"),
    @NamedQuery(name = "Salonxmd.findByNSlnId", query = "SELECT s FROM Salonxmd s WHERE s.salonxmdPK.nSlnId = :nSlnId"),
    @NamedQuery(name = "Salonxmd.findByNMdlDctId", query = "SELECT s FROM Salonxmd s WHERE s.salonxmdPK.nMdlDctId = :nMdlDctId"),
    @NamedQuery(name = "Salonxmd.findByVEstado", query = "SELECT s FROM Salonxmd s WHERE s.vEstado = :vEstado")})
public class Salonxmd implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SalonxmdPK salonxmdPK;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @JoinColumn(name = "nSlnId", referencedColumnName = "nSlnId", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Salon salon;
    @JoinColumn(name = "nMdlDctId", referencedColumnName = "nMdlDctId", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Modalidaddictado modalidaddictado;

    public Salonxmd() {
    }

    public Salonxmd(SalonxmdPK salonxmdPK) {
        this.salonxmdPK = salonxmdPK;
    }

    public Salonxmd(int nSlnId, int nMdlDctId) {
        this.salonxmdPK = new SalonxmdPK(nSlnId, nMdlDctId);
    }

    public SalonxmdPK getSalonxmdPK() {
        return salonxmdPK;
    }

    public void setSalonxmdPK(SalonxmdPK salonxmdPK) {
        this.salonxmdPK = salonxmdPK;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public Salon getSalon() {
        return salon;
    }

    public void setSalon(Salon salon) {
        this.salon = salon;
    }

    public Modalidaddictado getModalidaddictado() {
        return modalidaddictado;
    }

    public void setModalidaddictado(Modalidaddictado modalidaddictado) {
        this.modalidaddictado = modalidaddictado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (salonxmdPK != null ? salonxmdPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Salonxmd)) {
            return false;
        }
        Salonxmd other = (Salonxmd) object;
        if ((this.salonxmdPK == null && other.salonxmdPK != null) || (this.salonxmdPK != null && !this.salonxmdPK.equals(other.salonxmdPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Salonxmd[ salonxmdPK=" + salonxmdPK + " ]";
    }
    
}
